package pers.rcklos.myserver.dao;

import java.util.ArrayList;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import pers.rcklos.myserver.entity.PaperItem;

@Mapper
public interface PaperDao {
	/**
	 * 查询所有纸条
	 * @return 以线性表形式返回0..*份纸条数据
	 */
	ArrayList<PaperItem> queryAllPapers();
	
	ArrayList<PaperItem> queryPageOfPapers(@Param("skipNum")int skipNum, @Param("rstNum")int rstNum);
	
	/**
	 * 插入纸条数据
	 * @param uid		用户id
	 * @param title		纸条标题
	 * @param content	纸条内容
	 * @return
	 */
	int insertPaper(@Param("uid")int uid, @Param("title")String title, @Param("content")String content);
	
	/**
	 * 查询用户纸条
	 * @param uid		用户id
	 * @return			以线性表形式返回0..*份纸条
	 */
	ArrayList<PaperItem> queryPapers(@Param("uid")int uid);
	
	/**
	 * 查询纸条
	 * @param paperId	纸条id
	 * @return			返回纸条
	 */
	PaperItem queryPaper(@Param("paperId")int paperId);
	
	/**
	 * 删除纸条
	 * @param paperId	纸条id
	 * @return			返回更新条数
	 */
	int deletePaper(@Param("paperId")int paperId);
}
